<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="common/include :: header('员工添加')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-employee-edit" th:object="${employee}">
        <input name="id" type="hidden" th:value="*{id}">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">姓名：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name" required th:field="*{name}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">邮箱：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="email" required th:field="*{email}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">年龄：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="age" required  th:field="*{age}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否超管：</label>
            <div class="col-sm-8">
                <select name="admin" class="form-control" th:with="type=${@dict.getType('employee_status')}" th:field="*{admin}">
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否冻结：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control" th:with="type=${@dict.getType('employee_freeze')}" th:field="*{status}">
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">部门：</label>
        <div class="col-sm-8">
            <select name="deptId" class="form-control" th:with="type=${@dict.getType('dept-status')}"  th:field="*{deptId}">
                <option value="">所有</option>
                <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
            </select>
        </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入职时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="hiredate" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text" required  th:field="*{hiredate}">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="common/include :: footer" />
<th:block th:include="common/include :: datetimepicker" />
<script type="text/javascript">
    var prefix = ctx + "/business/employee";

    $("input[name='employeeTime']").datetimepicker({
        format: "yyyy-mm-dd hh:ii",
        autoclose: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-employee-edit').serialize());
        }
    }
</script>
</body>
</html>
